<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>疫苗基本信息管理</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		initVaccNameInfo(bsVaccineInfo.companyCode,bsVaccineInfo.vaccineId);
		initVaccCompanyName(bsVaccineInfo.companyCode);
		$(".vaccineCompany").change(function(){
			var vaccId = $(this).val();
			initCompanyNameInfo($(this).val());
			if(vaccId == ""){
				initVaccCompanyName("");
			}
		});
		$(document).on("click","#btnReset",function(){
		    $("#type").val("").select2();
		    $("#vaccineId").val("").select2();
		    $("#companyCode").val("").select2();
		    $("#spec").val("").select2();
		    $("#doseType").val("").select2();
			$("#customBillNo").val("");
		});
	});
	function page(n,s){
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
       	return false;
       }
	
	function down(){
		top.$.jBox.confirm("确认要导出疫苗基本信息数据吗？","系统提示",function(v,h,f){
			if(v=="ok"){
				$("#searchForm").attr("action","${ctx}/vaccinate/bsVaccineInfo/export");
				$("#searchForm").submit();
			}
			$("#searchForm").attr("action","${ctx}/vaccinate/bsVaccineInfo/findAll");
		},{buttonsFocus:1});
		top.$('.jbox-body .jbox-icon').css('top','55px');
	}
	
	var bsVaccineInfo = JSON.parse('${fns:toJson(bsVaccineInfo)}');
</script>
<style type="text/css">
	.minWidth {
		min-width: 177px;
	}	
	#contentTable td ,#contentTable th{
		text-align: center;
		padding:1px 12px;
	}
	#contentTable tbody tr td{
		font-size: 13px;
	}
</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/vaccinate/bsVaccineInfo/findAll">疫苗基本信息列表</a></li>
		<shiro:hasPermission name="vaccineinfo:bsVaccineInfo:edit">
		     <li><a href="${ctx}/vaccinate/bsVaccineInfo/form1?id=${bsVaccineInfo.id}">疫苗基本信息添加<shiro:hasPermission name="vaccinate:bsVaccine:edit">${not empty bsVaccineInfo.id?'修改':'添加'}</shiro:hasPermission></a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bsVaccineInfo" action="${ctx}/vaccinate/bsVaccineInfo/findAll" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	    <div class="breadcrumb">
			<table class="table table-bordered">
				<tr>
				    <th>疫苗类型：</th>
					<td>
						<form:select path="type" id="type" class="span2 minWidth">
							<form:option value="" label="--请选择--"/>
							<form:options items="${fns:getDictList('bs_vaccineInfo_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select> 
					</td>
					<th>疫苗名称:</th>
					<td>
						<form:select path="vaccineId" id="vaccineId" class="span2 minWidth vaccineCompany " >
							<form:option value=""  label="--请选择--"/>
						</form:select>
					</td>
					<th>生产企业：</th>
					<td>
						<form:select path="companyCode" id="companyCode" class="span2 minWidth selectCompany vaccCompanyName">
							<form:option value="" label="--请选择--"/> 
						</form:select>
					</td>
				</tr>
				<tr>
					<%-- <th>规格：</th>
					<td>
						<form:select path="spec" id="spec" class="span2 minWidth">
							<form:option value="" label="--请选择--"/>
							<form:options items="${fns:getDictList('bs_vaccineInfo_spec')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td> --%>
					<th>剂型：</th>
					<td>
						<form:select path="doseType" id="doseType" class="span2 minWidth">
							<form:option value="" label="--请选择--"/>
							<form:options items="${fns:getDictList('bs_vaccineInfo_doseType')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				    <th>批准文号：</th>
					<td colspan="3">
						<form:input type="text" path="customBillNo" class="input-medium" value="${bsVaccineInfo.customBillNo}"/>
					</td>
				</tr>
			</table>
		</div>
        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		<input id="btnReset" class="btn btn-primary" type="button" value="重置"/>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
	</form:form>	
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>编号</th>
				<th>疫苗名称</th>
				<th>疫苗全称</th>
				<th>疫苗属性</th>
				<th>生产企业</th>
				<th>规格</th>
				<th>剂型</th>
				<th>剂量</th>
				<th>容器类型</th>
				<th>批准文号</th>
				<th>大包装(支(粒)/箱)</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bsVaccineInfos" begin="0"  varStatus="status" >
			<tr>
				<td>
				     ${(page.pageNo-1)*page.pageSize+status.index+1 }
				</td>
				<td>
				     ${bsVaccineInfos.vaccineName}
				</td>
				<td>
				     ${bsVaccineInfos.vaccNameAll}
				</td>
				<td>
				     ${fns:getDictLabel(bsVaccineInfos.type,'bs_vaccine_type','')}
				</td>
				<td>
					  ${bsVaccineInfos.companyName}
				</td>
				<td>
				     ${bsVaccineInfos.spec}
				</td>
				<td>
				      ${bsVaccineInfos.doseType1}
				</td>
				<td>
					  ${bsVaccineInfos.dose}
				</td>
				<td>
					  ${bsVaccineInfos.containerTypeNam1}
				</td>
				<td>
					  ${bsVaccineInfos.customBillNo}
				</td>
				<td>
				      ${bsVaccineInfos.largePackage}
				</td>  
				<shiro:hasPermission name="vaccineinfo:bsVaccineInfo:edit"><td>
			        <a href="${ctx}/vaccinate/bsVaccineInfo/form1?id=${bsVaccineInfos.id}">修改</a>
				    <a href="${ctx}/vaccinate/bsVaccineInfo/delete?id=${bsVaccineInfos.id}" onclick="return confirmx('确认要删除该用户吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>